package com.jinbo.sxzq;

import android.util.Log;

/***********棋子牛********************/
public class Chess_Nui extends Chess{
    Chess_Nui(int type,int index, int[] location, int owner, GameControl gameControl) {
        /********初始化信息****************/
        super(index, location, owner, gameControl);
        this.type = type;
        this.name = ProjectConstants.ChessName.NUI;
        this.message = ProjectConstants.ChessMasage.NUI;
        this.type = ProjectConstants.ChessType.NUI;
        this.hp = 3;
        this.maxHp = 3;
        this.mp = 0;
        this.maxMp = 2;
        this.mobility = 2;
        this.maxmobility = 2;
        this.atk  =1;
    }

    public void Action(){
        super.Action();
    }

    public void Move(Chess chess){
        super.Move(chess);
    }

    public void Attack(Chess chess){
        super.Attack(chess);
    }

    public void RoundNext(){
        super.RoundNext();
    }

    //重写技能牛：【治愈】距离自己范围1内的友方棋子获得生命+1。
    public void Skill(){
        super.Skill();
        Log.e("Skill——牛" , "触发技能");
        for(int i = 0 ; i < gameControl.chess_list.size() ; i++){
            if(gameControl.chess_list.get(i).owner == owner){
                Chess chess = gameControl.chess_list.get(i);
                int length = Math.max(chess.location[0]-location[0],chess.location[1]-location[1]);
                if(length <= 1){
                    gameControl.chess_list.get(i).hp++;
                }
            }
        }
    }

    public void Kill(Chess chess){
        super.Kill(chess);
    }
}
